home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 25
/
AACD 25.iso
/
AACD
/
Magazine
/
Installer
/
Example1
< prev
next >
Wrap
Text File
|
2001-08-01
|
2KB
|
131 lines
; Procedures
;;; Setup message, prompt and help strings
(procedure SetStrings
(set
#OldInstaller
"You need at least version 43 of the Installer program\nYou can get this from any AACD"
#GetDestPrompt
(cat
"Where would you like to install " @app-name "\n\n"
"A drawer will be created."
)
#GetDestHelp
"blah..."
#InstallPrompt
"copying file"
#InstallHelp
"copying file"
)
)
;;;
;;;Check installer version
(procedure CheckInstaller
(if
(< (/ @installer-version 65536) 43)
(abort #OldInstaller)
)
)
;;;
;;; Confirm responses
(procedure ConfirmDetails
(askbool
(prompt
(cat
"\nYou have chosen to copy " @app-name " to "
#DestDir "\nand its documentation to " #DocPath
"\n\nDo you wish to proceed?"
)
)
(help #ConfirmHelp)
)
)
;;;
;;; Ask for the installation paths
(procedure GetDestination
(set #ProgDir "MyProg")
(set #DestDir
(askdir
(prompt #GetDestPrompt)
(help #GetDestHelp)
(default (expandpath "SYS:"))
)
)
(set #DestDir (tackon #DestDir #Progdir))
(if
(not (exists #DestDir))
(makedir #DestDir)
)
(set @default-dest #DestDir)
(set #DocPath
(askchoice
(prompt #DocPrompt1)
(help #DocHelp1)
(choices
#DestDir
"HELP:"
"HELP:English"
)
(default 0)
)
)
(set #DocPath
(select
#DocPath
#DestDir
"HELP:"
"HELP:English"
"Elsewhere"
)
)
(ConFirmDetails)
)
;;;
;;; Copy the program and docs
(procedure CopyProgram
(copylib
(prompt #InstallPrompt)
(help #InstallHelp)
(source "MyProg")
(dest #DestDir)
(confirm)
(infos)
)
(copyfiles
(prompt #DocPrompt2)
(help #DocHelp2)
(source "")
(dest #DocPath)
(pattern "#?.(guide|doc)")
(infos)
)
)
;;;
;;; Add assign and path to user-startup
(procedure AddAssign
(startup @app-name
(prompt #StartupPrompt)
(help #StartupHelp)
(confirm)
(command 'Assign >NIL: MyProg: "' #DestDir '"\n')
(command "Path MyProg: ADD")
)
)
;;;
; Main install
(welcome)
(SetStrings)
(CheckInstaller)
(until (GetDestination))
(CopyProgram)
(AddAssign)
(exit)